package com.lh.user.service.impl;

import com.lh.common.domain.User;
import com.lh.common.exception.ServiceException;
import com.lh.user.mapper.UserMapper;
import com.lh.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName：UserServiceImpl
 * @Author: LeiHao
 * @Date: 2024/8/9 14:15
 * @Description: UserService实现类
 * @Version: 1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    /* *
     * @Title: selectUserPhone
     * @Author: LeiHao
     * @Date: 2024-08-09 14:14:44
     * @Params: [userPhone]
     * @Return: User
     * @Description: 手机号查询用户信息
     */
    @Override
    public User selectUserPhone(String userPhone) {
        if (userPhone == null){
            throw new ServiceException("手机号不能为空!");
        }
        return userMapper.selectUserPhone(userPhone);
    }
}
